package com.wujilee.wujileejuc.juc01interrupted;

/**
 * @author liwuji
 * @date 2024/6/24
 * @desc
 **/
public class Demo {
    public static void main(String[] args) {

        Thread thread = new Thread(() -> {
            
            while (Thread.currentThread().isInterrupted()){
                System.out.println("线程未中断");
            }
            System.out.println("线程已中断");
            
            
        });
        thread.start();
        try {
            Thread.sleep(100L);
        } catch (InterruptedException e) {
            throw new RuntimeException(e);
        }
        

        thread.interrupt();
        
//        
        
        while (true){}
        

    }
}
